﻿Option Explicit On
Option Strict On

Imports Microsoft.VisualBasic

Public Class SendEmailViaGoogle

    Public Sub SendEmail(ByVal emailsender As String, ByVal emailreceiver As String, ByVal subject As String, ByVal bodytxt As String)
        Dim s As New System.Net.Mail.SmtpClient
        Dim emaillog As New LogginsLogDSTableAdapters.SPTableAdapter()
        Try

            'send the outgoing mail
            s.Send(emailsender, emailreceiver, subject, bodytxt)

            ' save the outgoing mail
            emaillog.usp_MembershipEmailsOutgoingLogInsert(emailsender, emailreceiver, subject, bodytxt, DateTime.Now)
        Catch ex As Exception
            Throw ex
        End Try

    End Sub
End Class
